package com.flying.acls.domain.context;


import com.flying.acls.model.ResType;

public class UrlExprContextBuilder {
    private ContextStringValueResolver resolver;

    public UrlExprContextBuilder(ContextStringValueResolver resolver) {
        this.resolver = resolver;
    }

    public ExpressionContext build(Object principal, Object accessingObject, Object permission) {
        ExpressionContext context = new ExpressionContext(accessingObject, principal, permission, ResType.URL);
        context.addEnvVar(resolver.getResourceClassName(), accessingObject.getClass().getName());
        return context;
    }
}